package us.mooresr.webtroopmanager.shared;

import com.google.gwt.user.client.rpc.IsSerializable;

public class VehicleSummary implements IsSerializable, Comparable<VehicleSummary> {
	private Long id;
	private Integer modelYear;
	private String make;
	private String model;
	private String owner;
	
	public VehicleSummary() {
		
	}

	public VehicleSummary(Long id, Integer modelYear, String make, String model, String owner) {
		this.id = id;
		this.modelYear = modelYear;
		this.make = make;
		this.model = model;
		this.owner = owner;
	}
	
	public String toString() {
		String name = modelYear.toString() + " " + make + " " + model + " owned by " + owner;
		return name;
	}
	
	public Long getId() {
		return id;
	}

	@Override
	public int compareTo(VehicleSummary o) {
		return id.compareTo(o.getId());
	}

}
